package com.test.login.util;

/**
 * @author gaoya
 * @date 2017/08/02
 * @describe ��������
 *
 */
public class GenerateKey {
	
	// ����Twitter��SnowFlake�㷨�Ķ���
	private static SnowflakeIdWorker idWorker;

	static{
		idWorker = new SnowflakeIdWorker(0, 0);
	}
	
	/**
	 * @author gaoya
	 * @param prefix ǰ׺
	 * @param suffix ��׺
	 * @return ͨ��ǰ׺�ͺ�׺������ϵ�����
	 */
	public static String getKey(String prefix, String suffix){
		
		if(prefix==null){
			prefix="";
		}
		
		if(suffix==null){
			suffix="";
		}
		Long longId=idWorker.nextId();
		return prefix+longId+suffix;
	}

}
